package com.testdocs.client.version.list;

import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;
import com.testdocs.client.signin.context.RequiresSignIn;
import com.testdocs.client.structure.menu.MenuItem;
import com.testdocs.client.structure.menu.RequiresMenuSelection;

public class VersionListPlace extends Place implements RequiresSignIn, RequiresMenuSelection {
	private String projectId;
	
	public VersionListPlace(String projectId) {
		this.projectId = projectId;
	}
	
	public String getProjectId() {
		return projectId;
	}
	
    public static class Tokenizer implements PlaceTokenizer<VersionListPlace> {
        @Override
        public String getToken(VersionListPlace place) {
            return place.getProjectId();
        }

        @Override
        public VersionListPlace getPlace(String token) {
            return new VersionListPlace(token);
        }
    }

	@Override
	public MenuItem getMenuItem() {
		return MenuItem.VERSIONS;
	}

}
